<script type="text/javascript">
$(function(){
//	$.get("inventorymanagement/getFilesInfo",getResponseFilesInfo,"json");
	$.post("inventorymanagement/getUserAndBanch",function(json){
		var activeUser = json.activeUser;
		var userNo=activeUser.userNo;
		var branchNo=activeUser.branchNo;
		$("input[name='tellernumber']").val(userNo);
		$("input[name='netpointnumber']").val(branchNo);	
})
	$("#queryDistributeTask").click(function(){
		var distributeTaskNo = $("#distributeTaskNoByReceiving").val();
		console.log("配送号===>"+distributeTaskNo);
		if(distributeTaskNo){
			if(distributeTaskNo.length<10 || distributeTaskNo.length>10){
				alertMsg.warn("配送任务号的长度为10位！");	
				return false;
			}else if(distributeTaskNo.length==10){
				var year = "20"+distributeTaskNo.substr(1,2);
				var month = distributeTaskNo.substr(3,2);
				var day = distributeTaskNo.substr(5,2);
				console.log("year==>"+year);
				console.log("month==>"+month);
				console.log("day==>"+day);
				var createDate = new Date(year+'/'+month+'/'+day);
				var dateFlag ;
				if(createDate.getFullYear() == year && (createDate.getMonth() + 1) == month && createDate.getDate() == day){
					dateFlag = true;
				}else{
					dateFlag = false;
				}
				if(dateFlag==false){
					alertMsg.warn("请输入正确的配送任务号");
					return false;
				}
			}
		}/* else{
			alertMsg.warn("配送任务号不能为空");
			return false;
		} */
	});
	$.post("inventoryIncomingMagOfBranch/getCardReceiving",getCardReceiving,"json");
});

function validateCheckBoxOR(){
	if($("input[name='cardReceivingtasked']:checked").length < 1){
		 alertMsg.warn("您未选择数据！")	
		 return false;
	}
	if(!$("input[name='cardReceivingtasked']:checked")[0]){
		alertMsg.warn("请确认是否有配送信息！")	
	}
} 

function openDialogTaskeds(a){
	//alert($(a).text());
	var parm=$(a).text()
	var options={"width":"800","height":"500","parm":parm};
	$.pdialog.open("inventoryIncomingMagOfBranch/cardReceiving","cardre", "任务详细信息",options);
	
}
</script>	

<div class="pageHeader ">

	<form id="pagerForm" method="post" action="inventoryIncomingMagOfBranch/getCardReceiving" class="pageForm required-validate" onsubmit="return validateCallback(this,getCardReceiving);">

		<input type="hidden" name="pageNum" value="" /> 
		<input type="hidden" name="numPerPage" value="" />
		<!-- <input type="hidden" name="pageCount" value="" /> -->
		<div class="searchBar">	
			<table class="searchContent">
			<tr>
				<td><label>配送任务号：</label></td>
				<td><input id="distributeTaskNoByReceiving" name="distributeTaskNo" type="text" size="20" ></td>
			</tr>
            <tr>
            	<td><label>网点编号：</label></td>
				<td><input  name="netpointnumber" type="text" size="20"  readonly="readonly"  unselectable="on"/></td>			
			</tr> 
			<tr>
				<td><label>员工编号：</label></td>
				<td><input  name="tellernumber" type="text" size="20"  readonly="readonly" unselectable="on" /></td>			
			</tr> 
			</table>
		<div class="subBar">
			<ul> 
				<li>
				<div class="buttonActive" ><div class="buttonContent" ><button id="queryDistributeTask" type="submit">查询</button></div></div>
				</li>
			</ul>
		</div>
		</div>
	</form>	
</div>

<form method="post" action="inventoryIncomingMagOfBranch/cardReceivingRegister" class="pageForm required-validate" onsubmit="return validateCallback(this,printViewPageAjaxDone);" >

		<!-- <input id="bankName" name="bankName" type="hidden" value="">
		<input id="companyName" name="companyName" type="hidden" value=""> -->

	 <div class="pageContent" >
<div id="cardRec">
		<table class="table" width="1100" layoutH="320">

			<thead>

				<tr>

					<th width="2%" align="center"><input type="checkbox" id="cardReceiv" name="cardReceivingtaskedByTotal" group="cardReceivingtasked" class="checkboxCtrl"></th>
					<th width="3%" align="center">序号</th>
					<th width="18%" align="center">申请批次号</th>
					<th width="12%" align="center">制卡任务编号</th>
					<th width="10%" align="center">配送任务号</th>
					<th width="8%" align="center">卡产品名称</th>
					<th width="10%" align="center">接收网点编号</th>
					<th width="15%" align="center">接收网点名称</th>
					<th width="6%" align="center">申请数量</th>
					<th width="6%" align="center">配送数量</th> 
                    <th width="15%" align="center">配送日期</th>
                    
				</tr>

			</thead>

			<tbody id="cardReceiving">
						

			</tbody>
			

		</table>
</div>
	 <div class="panelBar">

		<div class="pages">

			<span>显示</span>

			<select class="combox" id="numPerPageByIM" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value},'cardReceiving',getCardReceiving)">

				<option value="10">10</option>

				<option value="20">20</option>

				<option value="50">50</option>

				<option value="100">100</option>

			</select>

			<span id="totalCountByCardReceivingn" >条，共0条</span>

		</div>
		<div callback='getCardReceiving' id="paginationByCardReceiving" rel="cardReceiving" class="pagination" targetType="navTab" totalCount="0" numPerPage="5" pageNumShown="5" currentPage="0"></div>

	</div>
	<div class="formBar">
		
			<ul>
				<li>
				<div class="buttonActive" ><div class="buttonContent" ><button id="subTask" onclick="return validateCheckBoxOR()" type="submit">入库</button></div></div>
				</li>
			</ul>
			
		</div>

</div>

	</form>

	



